package tests;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
import java.util.Scanner;

public class KeyboardReading
{
    public static void main(String[] args)
    {
	InputStream keyboardInput;
	InputStream keyboard;
	OutputStream file;
	try
	{
	    keyboardInput = System.in;
	    Scanner scannerInput = new Scanner(keyboardInput);

	    keyboard = new FileInputStream("input.txt");
	    // Scanner scanner = new Scanner(keyboard);

	    file = new FileOutputStream("output.txt");
	    PrintStream printStream = new PrintStream(file);

	    while (scannerInput.hasNextLine())
	    {
		String line = scannerInput.nextLine();
		printStream.println(line);
	    }
	} catch (FileNotFoundException e)
	{
	    // TODO Auto-generated catch block
	    e.printStackTrace();
	}
    }
}
